import { HttpClient } from "@angular/common/http";
import { environment } from "../../../../../../../environments/environment";
import { ClusterComponent } from "../../../../riskCluster/cluster.component";
import { RiskCompanyMei } from "../../models/riskCompany.model";
import { RiskMeiModel } from "../../mei/models/riskMei.model";
import { ChangeDetectorRef } from "@angular/core";
import { ChartColumnModel } from "../../../shared/companyIndicator/models/chartColumn.model";
import { ClusterService } from "../../../../riskCluster/cluster.service";

/**
 * key issues model
 */
export class KeyIssuesModel extends ClusterComponent {

    public readonly resourcesUrl: string = environment.resourcesUrl;

    public baseline: RiskCompanyMei;

    public mei: RiskMeiModel;
    
    public elements: any[] = [];

    public currentComponent: string;

    public headerPercentWidth: number;

    public showLimit: boolean;

    public showAllIndicators: boolean = false;
    
    public getIndicatorDetails: Function;

    //The template requires at least 3 chart columns
    public columns: ChartColumnModel[];

    public indicatorToExpand: string;

    public meiType: string;
    
    constructor(private modelRef: ChangeDetectorRef) { 
        super(modelRef);
    }

    public errorReset(){
        this.baseline = undefined;
        this.mei = undefined;
        this.elements = [];
        this.currentComponent = undefined;
        this.headerPercentWidth = undefined;
        this.showLimit = undefined;
        this.showAllIndicators = undefined;
        this.columns = undefined;
    }
}